package com.shr.netease;

import java.util.Scanner;

public class Main3 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in) ;
		String str = sc.next() ;
		
		int count = 1;
		int maxCount = 1 ;
		for(int i = 1;i<str.length();i++){
			if(str.charAt(i) != str.charAt(i-1))
				count ++ ;
			else {
				if(count > maxCount){
					maxCount = count ;
				}
				count = 1 ;	
			}
		}
		System.out.println(Math.max(maxCount, count));
		sc.close();
	}
}
